<?php
class Forms_CreateCharacterForm extends Zend_Form 
{ 
    public function init()
    {
    	
    	//$this->addPrefixPath('forms_validators', 'forms/validators/', 'validate');
    	//$this->addElementPrefixPath('forms_validators', 'forms/validators/', 'validate'); 
        $this->setName('create_character');

        $charName = new Zend_Form_Element_Text('character_name');
        $charName->setLabel('Character Name')
        	->addPrefixPath('Form_Validator', 'forms/validators/', 'validate')
        	->setRequired(true)
        	->addValidator('NotEmpty')
        	->addValidator('UniqueDBTableEntryValidator',false,array('table'=>new Characters(), 'field'=>'name'));


        $class = new Zend_Form_Element_Select('class');
        $class->setLabel('Class')
              ->setMultiOptions(Classes::getClasses())
              ->setRequired(true)->addValidator('NotEmpty', true);          


              
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Create');

        
        
        $this->addElements(array($charName, $class, $submit));
        
    }

}
?>
